home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <dos.h>
- main()
- {
- unsigned segadd;
- if(allocmem(10, &segadd) != -1)
- {
- perror("Memory allocation failed");
- exit(0);
- }
- printf("10 paragraphs of memory allocated\n"
- "at segment address: %x\n", segadd);
- /* Free memory before exiting */
- if(freemem(segadd) != 0)
- {
- perror("freemem failed");
- }
- else
- {
- printf("The memory is released now.\n");
- }
- }